package com.fulu.javabase.proxy.staticproxy;

import com.fulu.javabase.proxy.entity.User;
import com.fulu.javabase.proxy.service.UserService;
import com.fulu.javabase.proxy.service.UserServiceImpl;

public class UserServiceProxy implements UserService {

    private UserServiceImpl userService;
    public UserServiceProxy(UserServiceImpl userService){
        this.userService = userService;
    }

    @Override
    public void add(User user) {
        System.out.println("开始添加用户");
        userService.add(user);
        System.out.println("添加用户结束");
    }

    @Override
    public void update(User user) {
        userService.update(user);
    }

    @Override
    public void delete(User user) {
        userService.delete(user);
    }

    @Override
    public User getUser(Integer id) {
        return userService.getUser(id);
    }
}
